/*
 * exception.cpp
 *
 *  Created on: 2010-10-17
 *      Author: tan
 */

#include "light-exception.h"

namespace light {

LightException::LightException() {
}

LightException::LightException(const char* message) {
	this->message = message;
}

LightException::LightException(std::string message) {
	this->message = message;
}

LightException::~LightException() throw() {
}

const char* LightException::what() throw()
{
	return this->message.c_str();
}

}

/**
 *	//FIXME memery leek
 */
char* __concat_exception(const char* file, const int& line, const char* msg)
{
	ostrstream ss;
	ss<<"exception at line ";
	ss<<line;
	ss<<" of file ";
	ss<<file;
	ss<<" : ";
	ss<<msg;
	return ss.str();
}
